using System;
using System.Linq;
using battlenet.wow.rt.domain.objects;
using battlenet.wow.rt.sdk.data.dto;
using battlenet.wow.rt.sdk.utility;

namespace battlenet.wow.rt.sdk.objects.mapper
{
    internal class ItemSocketsMapper : Remapper<ItemSockets>
    {
        public override void RegisterMappers()
        {
            Register(typeof(SocketsInfo), input => Map(input as SocketsInfo));
        }

        internal ItemSockets Map(SocketsInfo info)
        {
            var sockets = new ItemSockets
            {
                SocketBonus = info.SocketBonus,
                Sockets = info.Sockets.Select(s => s.Remap(new ItemSocketMapper())).ToList()
            };
            return sockets;
        }
    }
}